import React,{Component} from 'react';
import {connect}   from 'react-redux'
import { Layout,message }  from 'antd';
import {Switch,Route,Redirect} from 'react-router-dom'
import NavBar    from '../../components/head/navBar.jsx'

import HangQing from './hanqing/hangqing.jsx'
import Kline from './kline/kline.jsx'

import FooterNav from './footerNav/footerNav.jsx'
import "./home.less"
const { Header, Footer, Sider, Content } = Layout;




class Home extends Component {
    constructor(props){
        super(props)
        this.state={
             selCode:6882389
        }
        this.getCodefunc=this.getCodefunc.bind(this)
    }
    componentDidMount=()=>{
        console.log(this.props.login.sid,"sid")
    }
    getCodefunc(res){
        message.success(res)
    }
    render(){
        const {selCode}=this.state
        const props=this.props;
        const {sid} =this.props.login
        return(
            <Layout className="tn-main-view-layout" style={{height:"100%"}}>
                <NavBar props={props}></NavBar>
                <div className="tn-hangqing-content-container">
                        <HangQing sel={this.getCodefunc}></HangQing>
                    <div className="tn-kline-container">
                        <Kline selCode={selCode}></Kline>
                    </div>
                </div>
                <div className="tn-trade-content-panel">
                    <div>Content</div>
                </div>
                <Footer>
                    <FooterNav></FooterNav>   
                </Footer>
          </Layout>
        )
    }
}

export default connect(state=>state)(Home);